import Vue from 'vue';
import Router from 'vue-router';
import Main from '@/components/Main';
import Index from '@/components/home/Index';
//正在热映
import InTheaters from '@/components/home/InTheaters.vue';
//即将上映
import ComingSoon from '@/components/home/ComingSoon';
//top250
import Top250 from '@/components/home/Top250';
//北美票房榜
import UsBox from '@/components/home/UsBox';
//电影详情页
import MovieDetail from '@/components/home/MovieDetail';

//正在热映影片票房排行:柱状图
import Ranking from '@/components/home/Ranking';


import Search from '@/components/home/Search';

//个人中心
import Ucenter from '@/components/ucenter/Ucenter';
import Login from '@/components/ucenter/Login';
import Reg from '@/components/ucenter/Reg';
//切记注册路由
Vue.use(Router)

export default new Router({
    mode:'history',
    routes:[
        {
            path:'/',
            name:'Mian',
            component:Main,
            redirect:'/index',
            children:[
                {
                    path:'/index',
                    name:'Index',
                    component:Index,
                    meta:{
                        title:'首页'
                    }
                },
                {
                    path:'/intheaters',
                    name:'InTheaters',
                    component:InTheaters,
                    meta:{
                        title:'正在热映'
                    }
                },
                {
                    path:'/comingsoon',
                    name:'ComingSoon',
                    component:ComingSoon,
                    meta:{
                        title:'正在热映'
                    }
                },
                {
                    path:'/top250',
                    name:'Top250',
                    component:Top250,
                    meta:{
                        title:'Top250'
                    }
                },
               
                {
                    path:'/usbox',
                    name:'UsBox',
                    component:UsBox,
                    meta:{
                        title:'北美票房榜'
                    }
                },
               
                {
                    path:'/search',
                    name:'Search',
                    component:Search,
                    meta:{
                        title:'搜索电影'
                    }
                },
                {
                    path:'/moviedetail',
                    name:'MovieDetail',
                    component:MovieDetail,
                    meta:{
                        title:'电影详情'
                    }
                },
                {
                    path:'/ranking',
                    name:'Ranking',
                    component:Ranking,
                    meta:{
                        title:'票房排行榜'
                    }
                },
                {
                    path:'/ucenter',
                    name:'Ucenter',
                    component:Ucenter,
                    meta:{
                        title:'用户中心'
                    }
                },
                {
                    path:'/login',
                    name:'Login',
                    component:Login,
                    meta:{
                        title:'用户登录'
                    }
                },
                {
                    path:'/reg',
                    name:'Reg',
                    component:Reg,
                    meta:{
                        title:'用户注册'
                    }
                }
            ]
        }
        
    ]
})